﻿using System;
using System.Collections.Generic;

namespace Hydra.Shell.DelayObjects
{
    public interface IDelayedObject
    {
        TimeSpan? DelayTimeout { get; }
        bool ExceptionOccurred { get; }
        List<DelayedObjectHistoryItem> History { get; }
        event DelayedObjectHistoryHandler HistoryItemReported;
        bool IsReady { get; }
        event EventHandler<DelayedExceptionArgs> OnException;
        void ReportHistory(string historyDescription, TimeSpan? timeoutIfNoFollowUpHistory = null, bool noLog = false);
        void SetException(Exception exception);
        event DelayedObjectHistoryHandler TimeOutExceptionOccurred;
    }

    public interface IDelayedTypedObject<T> : IDelayedObject
    {
        T InnerObject { get; }
    }
}
